package com.neuedu.utils;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class GetConnectionUntils {
	private static final String DRIVER_NAME = "com.mysql.jdbc.Driver";
	private static final String  URL = "jdbc:mysql://localhost:3306/test2";
	private static final String USER_NAME = "root";
	private static final String USER_PASSWORD = "mysqladmin";
	private static Connection connection = null;
	
	public static Connection getOneConnection() {
		try {
			Class.forName(DRIVER_NAME);
			connection = DriverManager.getConnection(URL, USER_NAME, USER_PASSWORD);
			return connection;
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch(SQLException e) {
			e.printStackTrace();
		}
			return connection;
	}
}
